import { createRouter, createWebHistory } from 'vue-router'
import initRouterGuards from './guards/index'
import constantRoutes from './routes/constant_routes'

// 创建路由
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        ...constantRoutes
    ]
})

// 初始化路由守卫
initRouterGuards(router)

export default router